<?php
/* @var $this yii\web\View */

use yii\helpers\Html;
use yii\helpers\Url;
use yii\helpers\Markdown;

$this->title = 'Welcome to song\'s blog';
?>

<div class='row'>
    <div class='col-sm-12 col-md-10'>
        <?php foreach ($a as $k => $article) : ?>
        <div class='blog-post'>
            <h1 class='blog-title'>
                <a href='<?= Url::toRoute(['article/view', 'id' => $article->id]) ?>'>
                    <?= Html::encode($article->title) ?>
                </a>
            </h1>
            <div class='blog-meta'>
                <span class="time">
                    <span class="fa fa-clock-o"></span>
                    <?= Html::encode($article->pubtime) ?>
                </span>
                <span class="views">
                    <span class="fa fa-eye"></span>
                    <?= Html::encode($article->clicked) ?>次点击
                </span>
                <span class="comments">
                    <span class="fa fa-comments-o"></span>
                    <?= Html::encode(count($article->comments)) ?>条评论
                </span>
            </div>
            <div class='blog-content'>
                <?= mb_substr(Markdown::process($article->content), 0, 400) ?>
                ...
            </div>
        </div>
        <?php endforeach ?>
    </div>
    <div class='col-sm-12 col-md-2'>
        right bar
    </div>
</div>
